import { Injectable } from "@angular/core";
import { HttpService } from "http-service";
import { API } from "../../../shared/models/api-path-extension";

@Injectable()
export class TabCardService {
  api: API;

  constructor(private httpService: HttpService) {
    this.api = new API();
  }

  addCard(card): Promise<any> {
    return this.httpService.post(this.api.path({path: 'tabCard' }).baseURL, card).toPromise();
  }

  delCard(card): Promise<any> {
    return this.httpService.delete(this.api.path({path: 'tabCard' }).baseURL + '/' + card.id).toPromise();
  }
}
